home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996…tember: Reference Library / Dev.CD Sep 96 RL / Dev.CD Sep 96 RL.toast / mac / Technical Documentation / develop / develop Issue 27 / develop Issue 27 code / LaserWriter 8.4 Docs / Writing PPDs for 8.4 < prev   
Encoding:
Text File  |  1996-06-03  |  4.0 KB  |  24 lines  |  [TEXT/ttxt]

  1. Writing PPD files for use with LaserWriter 8 Version 8.4
  2.  
  3. LaserWriter 8.4 offers a new graphical way to customize the interface presented to the user for selecting printer-specific options that are defined in PostScript Printer Description (PPD) files. This document describes how to access those features. This document assumes you are already familiar with the PPD specification. If you are not familiar with how to make PPD files, you should first consult the "PostScript Printer Description File Format Specification Version 4.2", which is available from Adobe Systems, Incorporated at <http://www.adobe.com/PDFs/TN/5003.PPD_Spec_v4.2.pdf>
  4.  
  5. Displaying a Printer Icon
  6. In the "Change Setup…" dialog available when you select a desktop printer, there is an icon that represents the printer. This icon comes from the icon family (ICN#) resources with ID 128 contained within the PPD file.
  7.  
  8. Customizing the panels within the print dialog
  9. The items displayed within the Printer Specific panel of the print dialog are controlled by resources within the PPD file. There are two main resources you need to define, the 'ppdT' and an associated 'DITL' resource. A template for the 'ppdT' resource is contained within the LaserWriter 8.4 driver. The 'ppdT' resource you create needs to have the signature set to 'rbi1' and the version set to 1. The 'DITL' resource must have the same ID as the 'ppdT' resource. Also note that the coordinates within the 'DITL' resource are local to the print dialog, and you have the ability to construct a 'DITL' which would draw items over areas used by the driver. Don't do that. It will be a future compatibility problem.
  10.  
  11. Adding items to the 'ppdT' resource
  12. Once you've created the base resource you can add items to it. Items are added as follows:
  13. Checkboxes are defined by an item number, and the keyword which specifies which option they control. The Item number corresponds to the item number within the DITL. The keyword matches the name of an option as defined with the *OpenUI keyword in the PPD file.
  14. Radio Buttons are defined by a range of item numbers, which must be contiguous and a keyword.
  15. Menus are defined by an item number and a keyword. The item number must point to a control item within the 'DITL', which corresponds to a 'CNTL' resource which references the built-in Popup Menu CDEF. The Menu ID which is used should be in the range of resource IDs owned by a driver (-8160 to -4090) and must not conflict with existing menus within the driver. You must use IDs in the range of -7000 to -6500 to avoid conflicts with future revisions of the LaserWriter driver.
  16. PICT controls are the most complicated to define. The item number corresponds to a user item within the DITL that has the correct placement and size. The color-offID is the ID of a PICT resource to be displayed when the option is not chosen, and the monitor depth is 8-bit color or greater. The 1bit-offID is used when monitor depth is less than 8-bit color. The onID entries are similar, except for when the option is chosen. The forbiddenID entries are used when the option cannot be chosen due to a UIConstraint within the PPD file (usually the same as the off choice, except with an added red X through the picture). The main entry again corresponds to the keyword within the PPD, and the option entry corresponds to the option which is the "ON" state for that keyword.
  17.  
  18. Adding balloon help
  19. You can add balloon help to the items described in your DITL in the same way you would for  dialog items in an application. You add a help item to the DITL, it points to a 'hdlg' and that gets appended to any already existing balloon help. The only thing to remember is that the PICT controls used by LaserWriter 8 don't actually have multiple states, so you need to write the help string for those items so it covers all the possible cases. For more information on Balloon Help and the 'hdlg' resource, see Inside Macintosh: More Macintosh Toolbox, Chapter 3.
  20.  
  21. That's all there's to it. The best examples available are the PPDs supplied with LaserWriter 8.4 for use with Apple printers.
  22.  
  23. Dave Polaschek (dpolasch@apple.com)
  24. 6/3/96